﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NRCP.BusinessEntities;

namespace NRCP.BusinessLogicLayer
{
    public partial class NationalPlanDetailsYearlyBLL
    {
        public List<NationalPlanDetailsYearly> GetNationalPlanDetailsYearlys(Func<NationalPlanDetailsYearly, bool> query)
        {
            try
            {
                //CustomerContent
                List<NationalPlanDetailsYearly> result = _socialShareDatabaseContext.NationalPlanDetailsYearlies.Where(query).ToList();
                return result;
            }
            //handling other exceptions...
            catch (Exception ex)
            {
                //Error handling
                throw ex;
            }
        }

        public int GetSampleAllCount()
        {
            try
            {
                if (_socialShareDatabaseContext.NationalPlanDetailsYearlies.Count() > 0)
                    return _socialShareDatabaseContext.NationalPlanDetailsYearlies.Sum(obj => obj.Count);
                else
                    return 0;
            }
            catch (Exception ex)
            {
                //Error handling
                throw ex;
            }
        }

        public NationalPlanDetailsYearly GetNationalPlanDetailsYearly(Func<NationalPlanDetailsYearly, bool> query)
        {
            try
            {
                //CustomerContent
                NationalPlanDetailsYearly result = _socialShareDatabaseContext.NationalPlanDetailsYearlies.FirstOrDefault(query);
                return result;
            }
            //handling other exceptions...
            catch (Exception ex)
            {
                //Error handling
                throw ex;
            }
        }
    }
}